package arraylist;
//get提取元素用法,set替换元素用法
import java.util.ArrayList;
import java.util.List;

public class Test5 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);

        System.out.println(list.get(0));
        System.out.println(list.get(1));
        System.out.println(list.get(2));
        System.out.println(list.get(3));

        list.set(0,100);
        System.out.println(list);
    }
}
